function  [history_error,over,CNC_swork,CNC_state,r]=geterrorCNC(over,CNC_swork,CNC_state,nowtime,errortimelist,history_error)
% errortimelist
%if errortimelist(nowtime)==1

if(errortimelist(nowtime))
    r=randi([1,8],1,1);
    overtime=randi([10,20],1,1)*60;
    CNC_swork(r)=0;
    CNC_state(r)=0;
    over(r)=nowtime+overtime;
    history_error=[history_error;r,nowtime,nowtime+overtime];
else
    r=0;
end